package com.itheima.api.hashmap.demo04;

import java.util.HashMap;

public class HashMapDemo01 {

    public static void main(String[] args) {

        HashMap<String, Student> hashMap = new HashMap<String, Student>();

        Student s1 = new Student("zhangsan", 18);
        Student s2 = new Student("lisi", 23);
        Student s3 = new Student("wangwu", 20);

        hashMap.put("stu001", s1);
        hashMap.put("stu002", s2);
        hashMap.put("stu003", s3);

        hashMap.forEach((key, value) -> System.out.println(key + "----" + value.getName() + "----" + value.getAge()));

    }

}
